import axios from 'axios'
// 改变用户状态
export const changeUserState = async (uId, type) => {
  return axios.put(`users/${uId}/state/${type}`)
}
// 添加用户
export const addUsers = async (params) => {
  return axios.post(`users`, params)
}
// 根据id查用户信息
export const findUserInfo = async (id) => {
  return axios.get(`users/${id}`)
}
// 修改用户信息
export const editUserInfo = async (id, params) => {
  return axios.put(`users/${id}`, params)
}
// 删除用户
export const delUser = async (id) => {
  return axios.delete(`users/${id}`)
}
// 获取角色列表
export const getRolesLists = async () => {
  return axios.get(`roles`)
}
// 分配用户角色
export const assignRoles = async (id, params) => {
  return axios.put(`users/${id}/role`, { rid: params })
}
